import math
import torch

import numpy as np

def normal_distribution(x, mean, sigma):
    return np.exp(-1*((x-mean)**2)/(2*(sigma**2)))/(math.sqrt(2*np.pi) * sigma)

def mixed_2_gaussian_distribution(x, mean1, sigma1, mean2, sigma2):
    return 0.5*normal_distribution(x,mean1,sigma1)+0.5*normal_distribution(x,mean2,sigma2)

def stretched_sigmoid(x,mean=0,k=1):
    return 1/(1+np.exp(-1*k*(x-mean)))